#!/usr/bin/python3
# -*- coding:utf-8 -*-
# @Time : 2018/9/29 上午11:36
# @Author : Desunire
# @projectname : bzShop
# @name: adminx

import xadmin

from .models import BookCategory,Book

class BookAdmin(object):
    list_display = ['book_name','book_number','book_author','book_details',
                    'book_download_url','book_img_url','book_origin','book_size',
                    'book_download_times', 'last_chapter','keywords','initial','book_update_date'
                    ]
    search_fields = ['book_name','book_author']


class BookCategoryAdmin(object):
    list_dispaly = ['book_categoty', 'category_code', 'category_status']
    search_fields = ['category_code']
    list_editable = ["category_status"]
    list_filter = ['category_code', 'category_status']

xadmin.site.register(Book, BookAdmin)
xadmin.site.register(BookCategory, BookCategoryAdmin)
